[codex] add Pi provider driver (AGENT MISTAKE)#2856
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| } | ||
| return Effect.succeed(ctx); | ||
| }; | ||
|
|
There was a problem hiding this comment.
🟢 Low Layers/GeminiAdapter.ts:319
Semaphores in threadLocksRef are created per-thread but never removed when sessions stop. At line 330, sessions.delete(ctx.threadId) removes the session, but the corresponding semaphore remains in threadLocksRef. If many unique threadId values are used, the map grows unboundedly, causing a memory leak. Consider deleting the semaphore from threadLocksRef when stopping a session.
🤖 Copy this AI Prompt to have your agent fix this:
In file apps/server/src/provider/Layers/GeminiAdapter.ts around line 319:
Semaphores in `threadLocksRef` are created per-thread but never removed when sessions stop. At line 330, `sessions.delete(ctx.threadId)` removes the session, but the corresponding semaphore remains in `threadLocksRef`. If many unique `threadId` values are used, the map grows unboundedly, causing a memory leak. Consider deleting the semaphore from `threadLocksRef` when stopping a session.
Evidence trail:
apps/server/src/provider/Layers/GeminiAdapter.ts line 218: threadLocksRef = SynchronizedRef.make(new Map<string, Semaphore.Semaphore>()). Lines 228-244: getThreadSemaphore creates+inserts entries. Lines 320-338: stopSessionInternal deletes from `sessions` (line 330) but never from `threadLocksRef`. git_grep for 'threadLocksRef' confirms only two references (lines 218, 229) — no deletion path exists.
95b2705 to
71c7733
Compare
Summary
Adds Pi as an experimental built-in provider for T3 Code.
Deferredimports and using EffectCryptofor Pi runtime identifiersValidation
bun fmtbun lint(passes with existing warnings)bun typecheck